package YAPserver.behaviours;

import YAPserver.gameObjects.AbstractBall;
import YAPserver.gameObjects.GameBall;
import YAPserver.gameObjects.Mod;
import YAPserver.logic.Output;
import YAPserver.logic.Player;

public class CollideBallBounce implements CollideBehaviour {
	Mod m_mod;
	@Override
	public void collide(Player player, AbstractBall ball, Output out) {
		//this will automatically deactivate the mod
		if(ball instanceof GameBall){
			m_mod.setTicks(0);
			m_mod.setTimerOn(true);
		}
	}
	/**
	 * Sets the mod of this class so that when there is a collision between a GameObject and a BallAbstract this mod is deactivated.
	 * @param mod mod to be linked to this class.
	 */
	public void setMod(Mod mod){
		m_mod = mod;
	}

}
